package com.aubrey.threadDemo.lock;

public class MyLockDemo {
	private static MyLock myLock = new MyLock();
	public static void main(String[] args) {
		print();
	}
	
	public static void print() {
		System.out.println("进入print");
		myLock.lock();
		System.out.println("print获取myLock");
		count();
		myLock.unLock();
		System.out.println("释放myLock");
	}
	
	public static void count() {
		System.out.println("进入count");
		myLock.lock();
		System.out.println("count获取mylock");
		myLock.unLock();
		System.out.println("释放myLock");
	}

}
